from django.http import *

def loginRequired(func):
    def _wrapper(request, *args, **kwargs):
        if 'user' not in request.session:
            response = HttpResponseRedirect('/')
            return response
        else:
            return func(request, *args, **kwargs)
    return _wrapper
